package com.team_project.boot.mapper;

import com.team_project.boot.entity.Index;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IndexMapper {
    @Select("select id,url from banner order by created desc limit 0,3")
    List<Index> selectAll();

    @Insert("insert into banner(url) values(#{url})")
    void insert(Index index);

    @Select("select id,url from banner order by created desc")
    List<Index> selectBanner();
}
